//
//  MIDIMyindentController.m
//  迷笛
//
//  Created by . on 2018/9/10.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIMyindentController.h"
#import "MIDIMyindentCell.h"
#import "MIDIddxqController.h"
#import "MIDIMypaymentCell.h"

#define MIDIMyindentCellId @"MIDIMyindentCell"
#define MIDIMypaymentCellId @"MIDIMypaymentCell"

@interface MIDIMyindentController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)UITableView * Myindenttable;
@property(nonatomic,strong)MIDIMyindentCell * indentCell;
@property(nonatomic,strong)MIDIMypaymentCell * pymentCell;

@end

@implementation MIDIMyindentController

- (void)viewDidLoad {
    [super viewDidLoad];

    
    UIBarButtonItem *leftBarItem = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:self action:@selector(Block:)];
    self.navigationItem.leftBarButtonItem = leftBarItem;
    
    [self.navigationItem.leftBarButtonItem setImage:[[UIImage imageNamed:@"后退"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [self HomeUI];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
{
    return 5;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
    NSString * str = @"0";
    static NSString * cellID = @"cell";
    
        _indentCell = [tableView dequeueReusableCellWithIdentifier:cellID];
        if (_indentCell == nil)
        {
            _indentCell =[[MIDIMyindentCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
            _indentCell.backgroundColor =[UIColor colorWithHexString:@"#1B212F"];
            [_Myindenttable setSeparatorColor : [UIColor blackColor]];
            _indentCell.selectionStyle = UITableViewCellSelectionStyleNone;
        }
        _indentCell.orderNumber.text = @"订单编号：177788759878";
        _indentCell.mainiamge.image = [UIImage imageNamed:@"IMG_0195.jpg"];
        _indentCell.maintext.text = @"北部湾（钦州）迷笛音乐节";
        _indentCell.completeState.text = @"已完成";
        _indentCell.address.text =@"场次：2018-09-03  12:00";
        _indentCell.time.text = @"地点：北京市朝阳区朝阳公园325号创...";
        _indentCell.rmb.text = @"8张";
        _indentCell.price.text = @"750元";
        
        return _indentCell;
    
}
- ( UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
{
    return nil;
}
- ( UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;
{
    return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 178;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 1;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    MIDIddxqController * ddxq =[[MIDIddxqController alloc]init];
    [self.navigationController pushViewController:ddxq animated:YES];
}

// 返回上一级
-(void)Block:(UIButton * )sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = YES;
    self.navigationController.navigationBar.translucent = NO;//Bar的模糊效果，默认为YES

    self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"#171717"];
    self.title = @"我的订单";
      [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FFFFFF"],NSFontAttributeName : [UIFont fontWithName:@"Helvetica-Bold" size:WidthScale(17)]}];
    //    去掉导航黑线
    UIImage *img = [UIImage imageNamed:@""];
    [self.navigationController.navigationBar setBackgroundImage:img  forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
}
-(void)HomeUI
{
    [self.view addSubview:self.Myindenttable];
}
-(UITableView *)Myindenttable
{
    if (!_Myindenttable)
    {
        _Myindenttable = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,kDevice_Is_iPhoneX?HeighX(700):HeightScale(610)) style:UITableViewStyleGrouped];
        _Myindenttable.dataSource = self;
        _Myindenttable.delegate = self;
        _Myindenttable.backgroundColor = [UIColor colorWithHexString:@"#1B212F"];
        //        _Hottable.separatorStyle = UITableViewCellSeparatorStyleNone;
    }
    return _Myindenttable;
}
@end
